<template>
	<view>
		<web-view :webview-styles="webviewStyles" :src="url"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: '',
				webviewStyles: {
					// 设置跳转加载进度颜色
					progress: {
						color: '#55ffff'
					}
				}
			}
		},
		onLoad() {
			this.setURL()
		},
		methods: {
			setURL(){
				// const Openid = uni.getStorageSync('idCard');
				// const id = uni.getStorageSync('id');
				
				const idToken = uni.getStorageSync('idToken');
				// const idToken = '12806d15-602c-4954-8228-78d0aa42b3db'
				// const url = `http://120.78.172.10/h5/?id=${id}&pid=${Openid}&accessToken=${idToken}`;
				// this.url = url;
				// console.log('idToken的地址是: '+uni.getStorageSync('idToken'))
				let mac = "";
				uni.getStorageSync('wristbandMac').split(":").forEach((item)=>{
					mac = mac + item
				})
				console.log('拼接好的mac地址: '+mac);
				const url = `http://171.108.224.55:8989/rbis/page/realtime-location/location-sso.html?mac=${mac}&accessToken=${idToken}`
				this.url = url;
			}
			// setTimeout(()=>{
			// uni.setNavigationBarTitle({
			// title:‘app中要设置的标题’
			// })
			// },2000)
		}
	}
</script>

<style>
</style>
